load("@fbcode//buck2:proto_defs.bzl", "proto_srcs", "rust_protobuf_library_prost_0134")
load("@fbcode_macros//build_defs:export_files.bzl", "export_file")
load("@fbcode_macros//build_defs/lib:oss.bzl", "translate_target")

oncall("build_infra")

rust_protobuf_library_prost_0134(
    name = "buck2_data",
    srcs = glob(["src/**/*.rs"]),
    build_script = "build.rs",
    proto_srcs = ":data_proto",
    deps = [
        "fbsource//third-party/rust:derive_more",
        "fbsource//third-party/rust:hex",
        "fbsource//third-party/rust:prost-types-0-13-4",
        "fbsource//third-party/rust:serde",
        "//buck2/allocative/allocative:allocative",
        "//buck2/app/buck2_host_sharing_proto:buck2_host_sharing_proto",
        "//buck2/gazebo/dupe:dupe",
        "//buck2/gazebo/gazebo:gazebo",
    ],
)

proto_srcs(
    name = "data_proto",
    srcs = [
        "data.proto",
        "error.proto",
    ],
    visibility = ["PUBLIC"],
    deps = [
        translate_target("//buck2/app/buck2_host_sharing_proto:host_sharing.proto"),
    ],
)

export_file(
    name = "error.proto",
)

export_file(
    name = "data.proto",
)
